make sure the "Create folder" button doesn't get shown accidentally
authorBenjamin Otte <otte@gnome.org>
Thu, 25 Jun 2009 13:50:55 +0000 (15:50 +0200)
committerBenjamin Otte <otte@gnome.org>
Sat, 27 Jun 2009 09:32:57 +0000 (11:32 +0200)
Switching to search or recent files mode and back to browse mode made
the button visible previously

gtk/gtkfilechooserdefault.c

index ccb5453c07cd877848f31a7f28a06441051a7590..b6aae66939f9e1f0ed43680e9338497bf74f54c4 100644 (file)
@@ -5520,8 +5520,6 @@ update_appearance (GtkFileChooserDefault *impl)
          gtk_widget_hide (impl->browse_widgets);
        }
 
-      gtk_widget_show (impl->browse_new_folder_button);
-
       if (impl->select_multiple)
        {
          g_warning ("Save mode cannot be set in conjunction with multiple selection mode.  "
@@ -9131,7 +9129,11 @@ search_switch_to_browse_mode (GtkFileChooserDefault *impl)
   impl->search_entry = NULL;
 
   gtk_widget_show (impl->browse_path_bar);
-  gtk_widget_show (impl->browse_new_folder_button);
+  if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN)
+    gtk_widget_hide (impl->browse_new_folder_button);
+  else
+    gtk_widget_show (impl->browse_new_folder_button);
+
 
   if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
       impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
@@ -9696,7 +9698,10 @@ recent_switch_to_browse_mode (GtkFileChooserDefault *impl)
   impl->recent_hbox = NULL;
 
   gtk_widget_show (impl->browse_path_bar);
-  gtk_widget_show (impl->browse_new_folder_button);
+  if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN)
+    gtk_widget_hide (impl->browse_new_folder_button);
+  else
+    gtk_widget_show (impl->browse_new_folder_button);
 
   if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
       impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)